<?php
/**
 * Flea Site
 *
 * @copyright  Copyright (c) 2008 Movoin Studio (http://movoin.com)
 * @license    Apache License 2.0
 * @version    $Id: Company.php 130 2009-05-21 14:23:24Z movoin $
 */

/**
 * Controller_Company “关于我们”控制器
 *
 * @package Site
 * @subpackage Front
 *
 */

//{{include
FLEA::loadClass('Controller_Base');
//}}

class Controller_Company extends Controller_Base
{

    /**
     * 构造函数
     *
     * @return Controller_Company
     */
    function Controller_Company()
    {
        // 构造父类
        parent::Controller_Base();
    }

    /**
     * 显示控制台
     *
     */
    function actionIndex()
    {
        $data['site'] = (int)$_GET['site'];
        $data['pageid'] = $_GET['pageid'];
        $data['colkey'] = 'aboutus';

        //缓存名称
        $cache_id = 'page.nav.' . $data['site'];
        if($data['pageid'])
            $cache_id .= '.' . $data['pageid'];

        //从缓存中读取数据
        $navs = FLEA::getCache($cache_id, $this->lifetime, true, true);
        if(!is_array($navs)) {
            //载入单页模型
            $modelPage =& FLEA::getSingleton( 'Model_Singlepage' );
            $navs = $modelPage->getContentList($data['colkey'], $data['site']);
            FLEA::writeCache( $cache_id, $navs, true );
        }
        $data['navs'] = $navs;

        $this->_executeView('company', $data);
    }

}
